package com.ccc.demo2;

import scala.runtime.AbstractFunction2;

import java.io.Serializable;

//消息归并方法
public class MyMergeMsg extends AbstractFunction2<MyMessage, MyMessage, MyMessage> implements Serializable {
    @Override
    public MyMessage apply(MyMessage a, MyMessage b) {

       return new MyMessage(a.getBlack() + b.getBlack(), a.getWhite() + b.getWhite());
    }
}
